﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Map;
namespace WebTestSample
{
    public partial class Ip : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string ip = @"183.236.125.167
183.11.248.200
27.25.122.109
123.14.188.197
115.194.3.91
140.240.168.60
183.236.125.12
111.213.138.53
183.222.215.50
106.32.108.55
113.57.189.34
113.122.46.180
110.90.177.250
123.88.84.163
183.236.124.194
111.213.139.98
219.155.228.210
124.230.17.212
140.240.161.17
113.97.65.229
223.14.113.61
203.148.65.100
121.29.10.153
122.194.230.61
223.192.232.114
180.175.5.242
219.129.159.13
120.90.34.76
211.97.15.80
116.19.2.21
221.198.246.38
58.100.211.237
118.244.183.47
120.33.158.191
221.223.90.138
119.96.10.232
101.104.109.24
113.82.185.217
124.42.212.212
61.51.189.62
59.53.255.199
219.140.163.103
61.152.249.78
118.199.210.252
119.137.150.6
111.194.211.78
14.113.77.70
180.118.218.161
175.31.200.125
112.248.74.172
113.103.4.153
114.239.43.111
116.224.251.63
124.90.41.218
117.86.52.174
218.58.239.225
1.80.209.28
175.5.98.209
1.204.19.104
220.198.96.60
101.247.243.183
140.240.170.247
60.174.109.237
123.88.90.230
182.33.166.222
222.199.225.244
125.69.90.184
211.97.15.232
115.194.122.188
182.148.111.32
119.87.234.35
111.195.82.229
60.161.23.178";
            var ips = ip.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            foreach (var item in ips)
            {
                var location = item.Location();
                if (location.Content != null)
                {
                    this.literalIp.Text += ("ip:" + item).PadRight(30, ' ') + location.Address + "<br />";
                }
            }
            this.literalIp.Mode = LiteralMode.PassThrough;
        }
    }
}